package com.lizhi.yun.db.rsz.entity;/**
 * @program: hbsf
 * @name RszTrajectoryInfoEntity
 * @description: 轨迹字典表
 * @author: lizhi
 * @create: 2021-08-12 15:49
 */

import com.lizhi.mybatis.boot.Description;
import com.lizhi.yun.db.rsz.enums.RszTraTypeEnum;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;

/**
 *@program: hbsf
 *@name RszTrajectoryInfoEntity
 *@description: 轨迹字典表
 *@author: lizhi
 *@create: 2021-08-12 15:49
 */
@Data
@ToString
@Table(name = "rsz_trajectory_info")
@Entity
@Description("轨迹字典表")
public class RszTrajectoryInfoEntity extends AbstractVrEntity{

    @Id
    @Column(columnDefinition="varchar(30) COMMENT 'lid'")
    @Description("lid")
    public String lid;

    @Column(columnDefinition="varchar(30) COMMENT '字典id'")
    public String traId;

    @Column(columnDefinition="varchar(30) COMMENT '轨迹编号'")
    public String traNo;

    /**
     * @see com.lizhi.yun.db.rsz.enums.RszTraTypeEnum
     */
    @Column(columnDefinition="varchar(2) COMMENT '轨迹类型'")
    public String traType;

    @Transient
    public String traTypeText;

    @Column(columnDefinition="varchar(500) COMMENT '轨迹序号'")
    public String traIndex;

    @Column(columnDefinition="varchar(500) COMMENT '轨迹名称'")
    public String traName;

    @Column(columnDefinition="varchar(4000) COMMENT '轨迹图片完整名称'")
    public String traPicNm;

    @Column(columnDefinition="varchar(4000) COMMENT '轨迹图片所在项目地址'")
    public String traPicAdr;

    public String getTraTypeText() {
        if (RszTraTypeEnum.Tra_Type_00.getEnValue().equals(traType)){
            traTypeText = RszTraTypeEnum.Tra_Type_00.getEnName();
        } else if (RszTraTypeEnum.Tra_Type_01.getEnValue().equals(traType)){
            traTypeText = RszTraTypeEnum.Tra_Type_01.getEnName();
        } else if (RszTraTypeEnum.Tra_Type_02.getEnValue().equals(traType)){
            traTypeText = RszTraTypeEnum.Tra_Type_02.getEnName();
        } else if (RszTraTypeEnum.Tra_Type_03.getEnValue().equals(traType)){
            traTypeText = RszTraTypeEnum.Tra_Type_03.getEnName();
        }
        return traTypeText;
    }
}
